 {extends file="profile/layout.tpl"}
 {block name="title"}##NA_OTHER##{/block}
 {block name="script"}
  $(document).ready(function () {
	 $('#fromDate').datepicker({
     showOn: "focus",
       yearRange: "-80:+0",
	   changeMonth: true,
	   changeYear: true,
	   dateFormat: "mm-yy"
    });
	$('#toDate').datepicker({
     showOn: "focus",
       yearRange: "-80:+0",
	   changeMonth: true,
	   changeYear: true,
	   dateFormat: "mm-yy"
    });
	 $('table#social_activities td a.delete').click(function()
    {
        if (confirm("Are you sure you want to delete this row?"))
        {
            var id = $(this).parent().parent().attr('id');
            var data = 'id=' + id ;
            var url = '5_1.php?'+data+'&action=delete';
			window.location.href = url;
        }
    });
  }
  );
{/block}
{block name="name"}
    ##NG_SOCIAL_ACTIVITIES##
{/block}
{block name="content"}
   

    <div class="message {$type_message|default:'error'}" style="display:{$is_display|default:'none'};">{$message|default:''}</div>
    <div class="clear">
        </div>	
 
    <div class="box round first center">
        <table class="data display datatable" id="social_activities" name="social_activities">
            <thead>
                <tr>
                    <td bgcolor="#FFFFFF"><div align="center"><strong>
                         #
                    </strong></div></td>
                    <td bgcolor="#FFFFFF"><strong>
                        ##NG_ACTIVITY_NAME##
                    </strong></td>
                    <td bgcolor="#FFFFFF"><strong>
                        ##NG_TIME##
                    </strong></td>
                    <td bgcolor="#FFFFFF"><strong>
                        ##NG_ADDRESS##
                    </strong></td>
					<td bgcolor="#FFFFFF"><strong>
                        ##NG_ROLE##
                    </strong></td>
					<td bgcolor="#FFFFFF"><strong>
                        ##NG_UPLOAD_EVIDENCE##
                    </strong></td>
                    <td bgcolor="#FFFFFF" align="center"></td>
                    <td bgcolor="#FFFFFF" align="center"></td>
                </tr>
            </thead>
            
            <tbody>
            {foreach $social_activities|default:array() as $i}
                        
                {if $i@index is div by 2}
                    <tr class="even" id="{$i.Ma}">
                {else}
                    <tr class="odd" id="{$i.Ma}">
                {/if}
                    <td><div align="center">
                            {$i@index + 1}
                    </div></td>
                    <td>
                        {$i.TenHoatDong}
                    </td>
                    <td>
						{$i.TuNgay|date_format:"%m-%Y"} - {$i.DenNgay|date_format:"%m-%Y"}
                    </td>
                    <td>
                        {$i.DiaChi}
                    </td>
                    <td>
                        {$i.VaiTro}
                    </td>
					<td>
                                            <a href="download.php?url={$i.GiayChungNhan}">{$i.GiayChungNhan}</a>
                     
                    </td>
                    <td align="center"><a href="5_1.php?id={$i.Ma}&action=edit">##NG_EDIT##</a></td>
                    <td align="center"><a href="#" class="delete">##NG_DELETE##</a></td>
                </tr>            
                    
               
            {/foreach}
            </tbody> 
        </table>
    </div>
	<div class="clear">
        </div>
	

    <div class="box round first center">
        <h2>##NG_ADDITION_SOCIAL_ACTIVITY##</h2>
    <form id="frm5_1" name="frm5_1" action="5_1.php" method="post" enctype="multipart/form-data">
 
    <table class="data display datatable" cellpadding="10" cellspacing="10" 
        align="left" border="2">
        <tbody>
			<tr>
				<td style="vertical-align:middle"><strong>##NG_ACTIVITY_NAME##</strong></td>
				<input type="hidden" name="id" id="id" value="{$id}"/>
				<td>
					<textarea rows="4" cols="50" id="activity_name" name="activity_name">{$activity_name|default:''}</textarea>
				</td>
			</tr>
			
			<tr>
				<td colspan="2"><strong>##NG_TIME##:</strong></td>
			<tr>
				<td align="right">##NG_FROMDATE##:</td>
				<td>
					<input type="text" id="fromDate" name="fromDate" value="{$fromDate|default:''|date_format:'%m-%Y'}"/>
				</td>
			</tr>
			<tr>
				<td align="right">##NG_TODATE##:</td>
				<td>
					<input type="text" id="toDate" name="toDate" value="{$toDate|default:''|date_format:'%m-%Y'}"/>
				</td>
			</tr>
			
			<tr>
				<td><strong>##NG_ADDRESS##:</strong></td>
                <td>
                   <input id="address" type="text" value="{$address|default:''}" maxlength="100" size="50" name="address"/>
                </td>
			</tr>
			
			<tr>
				<td><strong>##NG_ROLE##:</strong></td>
				<td>
                   <input id="role" type="text" value="{$role|default:''}" maxlength="100" size="50" name="role"/>
                </td>			
			</tr>
			<tr>
				<td>
					<strong>##NG_UPLOAD_EVIDENCE##</strong>
				</td>
				<td>
					{if isset($evidence_uploaded)}					
					<a href="download.php?url={$evidence_uploaded}">{$evidence_uploaded}</a><br>
					{/if}
					<input id="evidence_upload" type="file" maxlength="255" size="40" name="evidence_upload"/>
				</td>
			</tr>
			
           
			
            <tr>
                <td colspan="2">
                    <div style="float:left; height:auto">
                        <input type="submit" value="##NG_SAVE##" name="save" class="btn btn-blue"/>
                    </div>
                    <div style="float:right; height:auto">
                        <input type="button" value="##NG_NEXT##" name="next" onclick="window.location.href='5.php'" class="btn btn-blue" />
                    </div>
                </td>
            </tr>

        </tbody>
    </table>
    </form>
    </div>
    <div class="clear">
        </div>
{/block}
